package com.example.business_oa.service;

import com.example.comment_oa.dubbo.DimissionServiceDubbo;
import com.example.comment_oa.pojos.Dimission;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
public class ZfDimissionService {
    @DubboReference(version = "1.0.0")
    DimissionServiceDubbo dimissionServiceDubbo;

    //新增离职申请数据
    @GlobalTransactional(timeoutMills = 300000)
    public int shenqinglizhi(Dimission dimission) {
        int shenqinglizhi = dimissionServiceDubbo.shenqinglizhi(dimission);
        return shenqinglizhi;
    }
    //离职审批成功
    @GlobalTransactional(timeoutMills = 300000)
    public int dimState(String dimName, String dimBianhao) {
        int i = dimissionServiceDubbo.dimState(dimName, dimBianhao);
        return i;
    }

    //离职审批失败
    @GlobalTransactional(timeoutMills = 300000)
    public int dimStates(String dimName, String dimBianhao) {
        int i = dimissionServiceDubbo.dimStates(dimName, dimBianhao);
        return i;
    }
}
